package com.roc.web.dwr;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.directwebremoting.annotations.RemoteMethod;
import org.directwebremoting.annotations.RemoteProxy;

import com.roc.dao.DaoException;
import com.roc.dao.ISQLBaseDao;

/**
*@auhor   zbl
*@date    2017年2月28日 下午1:47:41
*@desc    说明
**/
@RemoteProxy
public class BankQuery {
	private static Logger logger = LogManager.getLogger(BankQuery.class);
	
	@Resource(name = "sqlBaseDao")
	private ISQLBaseDao sqlBaseDao;
	
	//根据银行去匹配
	@RemoteMethod
	public List<Map<String, Object>> loadBankInfo(String code) {
		logger.debug("-----加载银行信息----");
		List<Map<String, Object>> queryResult = null;
		String sql = "SELECT  T.CODE as \"code\",T.NAME as \"name\" FROM TBL_UNIONPAY_BANKLIST T WHERE T.CODE LIKE '"+code+"%' ";
		try {
			queryResult = sqlBaseDao.querySqlToMap(sql);
		} catch (DaoException e) {
			logger.debug("加载银行信息",e);
		}
		return queryResult;
	}
	
}
